package com.lhkj.ct.meta.modules.gauge.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.lhkj.ct.base.mybatis.extension.service.impl.BatchHandleServiceImpl;
import com.lhkj.ct.meta.modules.gauge.mapper.LogicAssoMapper;
import com.lhkj.ct.meta.modules.gauge.model.entity.TblLogicAsso;
import com.lhkj.ct.meta.modules.gauge.service.LogicAssoService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * <p>
 * 逻辑题目关联表 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2023-10-09
 */
@Service
public class TblLogicAssoServiceImpl extends BatchHandleServiceImpl<LogicAssoMapper, TblLogicAsso> implements LogicAssoService {

    @Override
    public boolean removeByLocIds(Collection<?> logicIds) {
        return CollectionUtils.isEmpty(logicIds) && SqlHelper.retBool(getBaseMapper().delete(new LambdaQueryWrapper<TblLogicAsso>().in(TblLogicAsso::getLogicId, logicIds)));
    }
}
